part of 'component.dart';

class TagItem extends StatelessWidget {
  const TagItem({
    Key? key,
    required this.text,
    required this.isActive,
    this.spacing,
    this.icon,
    this.activeIcon,
    this.iconSize,
    this.onTap,
  }) : super(key: key);
  final String text;
  final double? spacing;
  final bool isActive;
  final Icon? activeIcon;
  final Icon? icon;
  final double? iconSize;
  final VoidCallback? onTap;
  @override
  Widget build(BuildContext context) {
    var _icon = !isActive ? icon : activeIcon;
    return InkWell(
      onTap: onTap,
      child: Row(
        children: [
          _icon ??
              Icon(
                isActive ? Icons.check_box : Icons.check_box_outline_blank,
                color: isActive ? ColorsUtil.blue : ColorsUtil.content,
                size: 20.r,
              ),
          SizedBox(
            width: spacing ?? 5,
          ),
          Text(
            text,
            style: pfMediumStyle(color: ColorsUtil.title, fontSize: 15.sp),
          )
        ],
      ),
    );
  }
}
